From 3d68466ab03c3f7f2879451a57acba65ed5b197f Mon Sep 17 00:00:00 2001 From: Howaner Date: Fri, 8 Aug 2014 18:55:05 +0200 Subject: Send the old slab to the client when the interact cancelled. --- src/Blocks/BlockSlab.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h index 214445eda..28fdbe7af 100644 --- a/src/Blocks/BlockSlab.h +++ b/src/Blocks/BlockSlab.h @@ -110,6 +110,17 @@ public: { return ((a_BlockType == E_BLOCK_WOODEN_SLAB) || (a_BlockType == E_BLOCK_STONE_SLAB)); } + + + virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override + { + if ((a_BlockFace == BLOCK_FACE_NONE) || (a_Player->GetEquippedItem().m_ItemType != (short)m_BlockType)) + { + return; + } + + a_Player->GetWorld()->SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player); + } /// Converts the single-slab blocktype to its equivalent double-slab blocktype -- cgit v1.2.3